made it safe to condense and rewrite