cleaning up, refactoring