Cleanup

Cleaner and better code structure