continue refactor and enhancements

continue refactor and enhancements