fixed some more encapsulation issues, many magic numbers remain.