Moved function to private