refactor dependency injections