refactored js and modified seed file