refactor to allow for more customization