Separate into functions.