Start putting code into separate functions