Refactoring text layer builder