Reorganize and split custom feature functions away from the lib