change procedural style to explicit return type: `def received(data: String): Unit = {`