splitting and renaming functions -> clearer code