 The location of the castle was important both because it controlled an important mountain pass , and possibly because Llywelyn claimed authority as the lord of the mountains and coasts of Wales : several of his castles appear to have been located with such political symbolism in mind . It is also possible that Llywelyn may have built his castle on top of the remains of a previous fortification constructed by Maelgwn Gwynedd , a king of Gwynedd in the 6th century , although no such remains have been found . 
