NX-620: Refactored, cleanup