why inner? this function should perhaps be renamed.