Refactored views to be dynamic