refactor class methods