Refactor Block class. Add blockFactory