add writer and prepare other parts