reworked the code to use static methods