Further cleaned and streamlined getInterface function