add block functionality to separate command and query