Small refactoring, and fix syslog priority