Refactoring constraints to use functional prototypal inheritance