Refactor to tidy up code and make rule#logic method private