Splitting up the code