modularize and beautify the code
Merge pull request #1 from jmurowaniecki/turned2class

modularize and beautify the code