Refactor class