Re-engineering software to enhance performance on HPC systems