Removed two major code smells