Logger + overall refactor