Updated logic for determining if registrations exist
Refactored javascript files