refactor and allow for parameters