map focus and slight refactoring