Refactored to minimize lines number of create function.