moving boilerplate to React objects