changed class structure a bit