refactor auto size elements to view objects