some refactorings + some pojos to hold basic state of a view