clean the code a bit