Restructures the code a little bit. Two new to-do items in the GitHub for optimization.