includes hanlder for newEdit and cleans-up code.