make code more tidy