Refactorings: add_token fn, error -> common, print_tokens flag