Refactoring: Extract function to create text & box