Code organization

. Organized the code a bit to make it easier to read and add