Some modification/optimization