parsing config appears to work, but needs cleaning up