refactoring the structure