reduce unnecessary  code