Removing compiler warnings. Improving code structure.