Re-organized the code and removed test keys.