Code cleanup

Starting to focus on the Repository to get it cleaned up and then will document