Refactored dependency creation