Refactored some class