now there is only one function for creating angular parts; added support for angular factory