removed javascript duplication