code improved

Signed-off-by: Sampath Liyanage <plbsam@gmail.com>