Clean up + optim option + removal of useless copies
Merge pull request #16 from JoeTheDentist/misc/refactoring

Misc/refactoring