refactored some structure