refactored old js core in a separate folder