Remove code dealing with edgecase, has too many side effects