Some major structural changes
Code cleanup