refactored it to single file