Make attribute reader more flexible with blocks