starting refactoring..