These two methods repeat in several places. Use a module and mix them in?