factory moved in system module, added lots of LOG_FUNCTION_SCOPE macroses