Add parsing functions and fix modularity