refactored schemeIf
removed old debug code
added Logger, moved debug log output to logger