Re-org of code

Moved code to appropriate own files to improve structure