optional params; refactoring