Moved common functions into separate file, refactored psychic.py