Starting to work on making the code more maintainable.