Despite a big progress in solving planning problems, more complex problems still remain hard and challenging for existing planners. One of the most promising research directions is exploiting knowledge engineering techniques such as (re)formulating the planning problem to be easier to solve for existing planners. In particular, it is possible to automatically gather knowledge from toy planning problems and exploit this knowledge when solving more complex planning problems. In this paper we propose a method for eliminating some actions from the problem specification that are often useless or may mislead the planners. The method detects if actions are somehow connected with the initial or goal predicates and by using this information we suggest that some actions are not necessary when solving the planning problem. To eliminate these actions we modify the planning domain and hence the method remains independent of used planning system.