Small refactor to prevent copy paste code