Cleaned up the code from the last commit, removed unused code and improved the variable names.

Issue: GRL-7
Change-Id: Iafe7a4a9b9e12e4e5b08183e2c9deb81b0c4df52