Final refactor, to allow arbitrary attributes hash.