Got rid of redundant code