Removed unnecessary variable and renamed some code names