Small code refactor as suggested by @aaronldunlap