made code more simple