Minor refactoring.

Signed-off-by: Natraj Kaushik <natraj.iitb@gmail.com>