reorganize method order and dedup use of const_defined?