deleted a lot of redundant code