made code more organized