further php code tidying