Adds support for splines; code cleanup.