Moved helpers back into lib