Did a bit of retrofactoring. Fixed some redundancy.