Refactoring all code to classes.