Little code refactor and rewrite steps