Cleanup toSign code