Refactor dependency resolver + add test for later on