cleaning code and allowing logging via syslog