Refactor classes