Refactoring on major issues (unused varaibles)