Cleanup of incoming code