Moving function to private