refactor code base