huge refactoring: methods moved to classes, major logging improve

it's a virtual method