How can we reduce this boilerplate?