CLEANING UP THE CODE