Compact promise pattern implementation and more