refactored to use pluggable views