Cleaned up functionality.