refactored blocks and their functions into separate classes