Removed code duplication
Removed mutability from external API