adding completion block and refactoring init and factory methods