Some small changes to make the code neater