reorganize code for travis-ci complexity failures