Fixing warning
Moving the miner code to own file