refactor to be prototypical