converting those ruby blocks