Adding few changes and cleaning up the code

- Added few common naming conventions
- Cleanedup code
- Added a simple utility function

Signed-off-by: Santhosh Edukulla <Santhosh.Edukulla@citrix.com>