implemented main view like a custom class