refactoring handling of forward-references