Make function clearer by removing do-syntax