Minor code cleanup and improvements

Signed-off-by: ajayk <ajaykemparaj@gmail.com>