refactoring code, dropping unneeded