Starting to reorganize the code with classes