Meta box refactor

Closes #3458.