Small refactoring in fx.js to reduce final filesize