Implemented some extension methods.