Refactor block functions to simplify