Refactoring: all private functions now start with an underscore