Refactored RichJs