fix warn msg. and refactor