Cleaned up and organized code.