refactor code and some IT's