Pulled code into smaller files.
Removed pointless buffers.