refactor core rules
added log function