Moved "temporary" code to its own function