Implementing views for custom tables