See commits for details