full refactor of classes