LSystems optimization and refactoring