made code a bit tidier