finished refactoring unneeded code