factor out generic method for creating basic blocks
making configuration more flexible