Refactor calsses