Chore/extract reused hash key

Small cleanups, hope they are considered helpful. 

Feedback most welcome.