Refactor classc