Cleaned up unused code; Cleaned up output and filter hooks