Move library() calls to helpers.R, add profile functions