Refactor to use blocks based model