Refactored some structure