Refactored all static functions to be non-static