Simplifies the parser code
Adds type declarations and removes unused libreries