Before refactoring the main build method
done - refactor
Added regex for recognizing type and name