refactor block load

using nested functions