make parsing generic
move public method down