Refactor; Add dependency analysis