refactored Medhavi and InitKB.medha