Refactor to add OpenAppendType subroutine