Made most methods private and adjusted tests.