Moved implementation to separate file.