code review & refacto