refactor logger and fix user model