Fist refactor code