Split code into core and frontend functions