Refactor to get rid of 2 lines of redundant code