Clean code

Cleaned up data structure code.