code refactoring plus translatable message format

Signed-off-by: Smita Kumari <kumarismita62@gmail.com>