more refactoring
clean up / fix typos
collect small funs in utils.R
refactoring