refactoring + improved structure
code cleanup