Refactored code to support initial configuration through blocks