clean up and encapsulation