some high-level module code refactoring - just to be little more object oriented