use functions over blocks

should lead to better performance in Rubinius and jRuby