Slight refactor to make dict lookup clearer