refactor and cleanup