refactor to expose API based on an assignment-style expression instead of block