Refactor metadata parsing to be performed when the user clicks a button (Fix #142)