made class structure better, code more efficient