Major clean up of pillbox and validation