Refactored and extended minJS