added utility functions and ui components.