Exploiting structure in nonconvex quadratic optimisation