build public and cleanup