Moving some code to be reused later