improve regexp for brick-dev arg, refactor initializing some global vars