source format and cleanup