refactoring view for preview