refactoring code
cleaning up refactor