Refactoring frame/header creation