Refactoring of struct