Added view stuff and some common functions
views files