cleaning code, refactor done