Extracted key-code execution into a module