Just reorganizing some code