Refactor and cleanup data view