Removed redundant var assignments and console logs