Dev - refactor and cleanup