Improve Spire code