pica: cleanup code