Added pipeline support and cleane up.