More optimized code

Optimization of the code, creation of various class hierarchy, shifting
protection level now supported.