LPS-39397 Theme export import bug fix and refactoring