Refactor. added reverce code.