First refactor of classes