further refactoring - all compilations errors resolved.