Minor codde refactor