Cleaned up rewrite a little