moved static functions to class methods, added init to constructor