refactor and improvements