some cosmetic changes and small improvement in optimiser