[refactoring] better attribute handler in rest route method