simplified UI and made more generic