Factor out is_translatable workaround
Various coding style improvements