Just some design patterns with Javascritp