Switch from function definition to function expression style

Signed-off-by: Vivek Rai <vivekraiiitkgp@gmail.com>