moved unit class to unit.js