Move single steps into own functions to clean up the code