Removed an unused method and variable. And small code cleanup.