Using component factory in creating castles and tiles