Lint fixes; Merge function for duplication