Removed redundant code to shorten file size