cleans up the code