Coding normal synchronous code that can also be asynchronous