Rework promise usage