Trying to implement a class and restructure