linter now passing on lib folder, much refactoring to satisfy method length requirements