Got rid of redundant function