encapsulated functions