Could you restructure so that there is an else { return null }? The control flow by returns makes it a little difficult to read.