moved everything inside the class