move view controller code to it's own lua file