extract some lib functions, rename dayview and journal refs