tidying up code, removing console logs