code refactor & maps