refactor this because of new ctx api relationships