refactor to be UIViewbased