minor updates simplifying the code