87 organize code

https://github.com/kfgodel/diamond/issues/84