Attempt to test AST stuff. Code refactoring.