proper logging and hooks