Refactored with better config and includes