Moved functions to private