code additions for actions and refactor.. wip