Changed some function to private