remove view for reference, shuffle the order of some declarations