Moved interval partition code into its own class