Don't refer to localStorage from view

Abstract the logic and confine to controller, view should only see the one array