lint & reduce complexity
remove unused function