Change closeTag() to private and add new method close()