Move a couple of lines to functions