refactor class