Code cleanup :

Removed unused parameters, unused methods. Simplified some conditions

Post commit code review : Daniel Jao