refactoring removed useless code