more refactoring that now uses functions to generate the main view function.
minor refactoring of renderbody
moved input and btn to functions.
moved table to a separate function
tried out some refactoring techniques