Added testability and option to indicate promises