refactor, pass in arguments