Changing the structure of the program, creating individual class for each function