Restructure code and make major enhancements to way it parses.