Refactored into class