Refactored Code -_-