Improved MockController features (merged from @namutaka's code)