Use function instead of private method