refactoring the structures