Some minor changes to the existing code