Refactoring proxy initialization for connection to persistence container