put some stuff into its own function