Made the code a bit nicer