migration and base for functions