Refactor loose methods into classes