removed unnecessary code, refactoring