Refactor and code clean