moved parser functions for contigs, declared helper functions as static