Finalizing keys refactoring