Refactored some login from the Transcompiler into private methods