refactor return insertion logic; add return insertion to getters and
selected functions.