Removed more code duplication/Code cleanup