Refactors a bit select key API. Though there is still a code smell.