Started simplifying the logic