Moved functions outside of class