Cleaned up lots of code - easier to read