code refactor and standard