Modified functionality to use resolve and inject variables into controllers