refactors code to use dynamic segment and dynamic display