Should this be a method in the class? It would make the code less cluttered