Refactoriong some code for later.