made code more readable, cleanup stuff