cleanup on logic for better ux