refactored script on _home