refactoring and structure changes