Refactor class methods into scopes