Convert magic number into constant
Move Keys from ./misc --> ./
Minor refactorings per PR comments