Implemented Abstract factory pattern