refactor allowing arbitrary attributes hash