added foundation and refactored views and controllers in separate files