factored more nicely