Minor changes : Refactoring, formatting and code clean up.