simplifying code, removing unused code