fixed mock, refactored Swift.js