get rid of local function; that is bad!