simplifying logc and removing unwanted test