Code Re-factoring

Enabled the Lint and have done some code re-factoring for better
performance