moving compareAttributes to its own module