removed dead code and unused parameters