put more code into functions