got rid of redundant code