Refactored externalization to use static typing as possible