moving everything to a class