split up the code