made the code a bit cleaner