refactoring + loggable trait