Simplify definitions, refactor