removed a lot of unnecessary duplication