refactor: use optional parameters for dependancy injection