Move getRandomBlock method to the Block class