fixed typos and refactored.

Signed-off-by: Blessing Osakue <iyoworks@gmail.com>