Minor changes to simplify code