That is a LOT of code for a pretty basic feature.