Preparing view functions.