Cleaned it up a bit. I'll probably need to add a replace for each branch
type...