refactor of classes