improved logging in and optimized setupModule