Refactor.

Signed-off-by: Sanjeev BA <iamsanjeev@gmail.com>