moving the code-preprocessing part in its own function