add git ignore
reduce cyclomatic complexity