Added the basic classes + some refactoring